package com.medical.admin.hospital.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.medical.admin.hospital.common.vo.ProjectVo;
import com.medical.admin.hospital.entity.ComboType;
import com.medical.admin.hospital.entity.Project;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

public interface ProjectMapper extends BaseMapper<Project> {
    default Project findByProjectName(String projectName){
        LambdaQueryWrapper<Project> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(projectName!=null,Project::getProjectName,projectName);
        return this.selectOne(queryWrapper);
    };

    Integer insertProjectCombo(@Param("projectId") Long projectId,@Param("ids") ArrayList<Long> ids);

    List<ProjectVo> pageList(@Param("comboId") Long comboId,  @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);
}